<?php
/**
 * Display item of a list.
 *
 * $content - mandatory string - Content to display
 * $id - optional string - Contains the id of li tag
 * $class - optional string - Contains the class name(s) of li tag
 * $mysql_help_page - optional string - Related help page
 * $url - optional array: - href - optional string - Destination page or anchor
 *                        - target - optional string - Target of link
 *                        - class - optional string - Class of link
 *                        - title - optional string - Title of link
 */
?>
<li <?= !empty($id) ? ' id="' . $id . '"' : null ?>
    <?= !empty($class) ? ' class="' . $class . '"' : null ?>>

    <?php if (isset($url) && is_array($url) && array_filter($url)) : ?>
        <a<?= !empty($url['href']) ? ' href="' . $url['href'] . '"' : null ?>
        <?= !empty($url['target'])
            ? ' target="' . $url['target'] . '"'
            : null;
        ?>
        <?= !empty($url['target']) && $url['target'] == '_blank'
            ? ' rel="noopener noreferrer"'
            : null;
        ?>
        <?= !empty($url['id']) ? ' id="' . $url['id'] . '"' : null; ?>
        <?= !empty($url['class'])
            ? ' class="' . $url['class'] . '"'
            : null;
        ?>
        <?= !empty($url['title'])
            ? ' title="' . $url['title'] . '"'
            : null;
        ?>>
    <?php endif; ?>
        <?= $content ?>
    <?php if (isset($url) && is_array($url) && array_filter($url)) : ?>
        </a>
    <?php endif; ?>
    <?php if (!empty($mysql_help_page)): ?>
        <?= PMA\libraries\Util::showMySQLDocu($mysql_help_page) ?>
    <?php endif; ?>
</li>
